﻿using System;

public interface A
{
    double Area();
}

public interface B
{
    void SetColor(string c);
}

public interface C : A, B
{
    void Volume();
}

public class Cylinder : C
{

    private double radius; 
    private double height; 
    private string color;  

    public Cylinder(double radius, double height, string color)
    {
        this.radius = radius;
        this.height = height;
        this.color = color;
    }

    public double Area()
    {
       
        return 2 * Math.PI * radius * (radius + height);
    }

    public void SetColor(string c)
    {
        color = c;
    }

    public void Volume()
    {

        double volume = Math.PI * Math.Pow(radius, 2) * height;
        Console.WriteLine($"圆柱体体积: {volume:F2}");
    }

    public string GetColor()
    {
        return color;
    }
    public void DisplayInfo()
    {
        Console.WriteLine($"圆柱体信息 - 半径: {radius}, 高度: {height}, 颜色: {color}");
        Console.WriteLine($"圆柱体表面积: {Area():F2}");
        Volume(); 
    }
}

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("=== 圆柱体计算程序 ===\n");

    
        Cylinder cylinder = new Cylinder(5.0, 10.0, "红色");

        Console.WriteLine("初始圆柱体信息:");
        cylinder.DisplayInfo();

    }
}